import 'package:shortmovieapp/common.dart';
import 'package:shortmovieapp/http/core/HttpRequest.dart';
import 'package:shortmovieapp/http/core/dio_adapter.dart';

abstract class AppHttpRequest extends HttpRequest{
  
  static String domain = "192.168.31.144";
  static int port = 7014;

  String get relativePath;
  HttpMethod get method;

  AppHttpRequest({bool https = true,String contentType = "application/json"})
  {
    url = getUrl(https, domain,port, relativePath);
    //Debug.log("url:$url");
    httpMethod = method;
    adapter = DioAdapter();
    super.contentType = contentType;
  }

  String getUrl(bool https,String domain,int port,String relativePath){
    if(https){
        return "https://$domain:$port/$relativePath";
    }
    else{
        return "http://$domain:$port/$relativePath";
    }
  }
}